package com.farmcode.console.api.model;

import com.farmcode.base.web.RowSelectedSpc;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.OneToMany;
import java.util.List;

@Entity
@Table(name="FC_LANGUAGE")
public class Language extends RowSelectedSpc implements Serializable {
	//Fields
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID", unique=true, nullable=false, precision=18, scale=0)
	private Long id;
	@Column(name="NAME", unique=true, nullable=false, precision=20, scale=0)
	private String name;
	@Column(name="ACTIVE", unique=true, nullable=false, precision=1, scale=0)
	private String active;
	@OneToMany(mappedBy="language")
	private List<Project> projectCollection;
	
	//Default Constructor
	public Language() {}
	//Constructor, Parameters
	public Language(Long id, String name, String active){
		this.id = id;
		this.name = name;
		this.active = active;
	}
	//Getters and Setters
	public void setId(Long id){
		this.id = id;
	}
	public Long getId(){
		return this.id;
	}
	public void setName(String name){
		this.name = name;
	}
	public String getName(){
		return this.name;
	}
	public void setActive(String active){
		this.active = active;
	}
	public String getActive(){
		return this.active;
	}
	public List<Project> getProjectCollection(){
		return this.projectCollection;
	}
	public void setProjectCollection(List<Project> projectCollection){
		this.projectCollection = projectCollection;
	}
	@Override
	public String toString(){
		return super.toString();
	}
	
	
}
